home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
asmexam.arc
/
ASCADJ.LST
< prev
next >
Wrap
File List
|
1984-08-09
|
2KB
|
63 lines
The Microsoft MACRO Assembler 08-09-84 PAGE 1-1
PAGE 55,132
0000 CODE SEGMENT PARA
ASSUME CS:CODE,DS:CODE
0100 ORG 100H
; ------ ADD TWO PACKED BCD NUMBERS -------------
0100 B0 15 MOV AL,15H
0102 04 09 ADD AL,09H ; 15 + 9 = 24 BCD
0104 27 DAA ; DECIMAL ADJUST ADDITION
; -------- ADD TWO 4 DIGIT PACKED BCD NUMBERS --------
; 1098 + 1005 = 2103
0105 B0 98 MOV AL,98H
0107 04 05 ADD AL,05H ;AL = AD
0109 27 DAA ;AL=03
010A 8A D8 MOV BL,AL
010C B0 10 MOV AL,10H
010E 14 10 ADC AL,10H ;AL = 21H
0110 27 DAA
0111 8A F8 MOV BH,AL ;BX = 2103 BCD
;------- SUBTRACT TWO BCD NUMBERS
0113 B0 53 MOV AL,53H
0115 2C 49 SUB AL,49H ; AL= 0A
0117 2F DAS ; DECIMAL ADJUST SUBTRACTION AL= 04
; SHOW USE OF AAA ON UNPACKED BCD NUMBER (ZN)
0118 B0 31 MOV AL,31H
011A 04 39 ADD AL,39H
011C 37 AAA ; ASCII ADJUST ADDITION
011D B0 31 MOV AL,31H
011F 2C 39 SUB AL,39H
0121 3F AAS ; ASCII ADJUST FOR SUBTRACTION
0122 CODE ENDS
END
The Microsoft MACRO Assembler 08-09-84 PAGE Symbols-1
Segments and groups:
N a m e Size align combine class
CODE . . . . . . . . . . . . . . 0122 PARA NONE
Warning Severe
Errors Errors
0 0